package org.jawp.persistence;

import java.util.LinkedList;
import java.util.List;

public class Category implements Content {

	// members
	private final int id;
	private String name;
	private int motherCategory;
	
	// constructor
	public Category(int id, String name, int motherCategory) {
		super();
		this.id = id;
		this.name = name;
		this.motherCategory = motherCategory;
	}
	
	// getters

	public String getName() {
		return name;
	}

	public int getMotherCategory() {
		return motherCategory;
	}

	public int getId() {
		return id;
	}
	
	// setters
	
	public void setName(String newName) {
		this.name = newName;
	}

	public void setMotherCategory(int newMotherCategory) {
		this.motherCategory = newMotherCategory;
	}
	
	// generic methods
	
	@Override
	public String toString() {
		return "Category named "+name+" (id = "+id+")";
	}

	@Override
	public boolean equals(Object obj) {
		if( (obj instanceof Category) && (this.id == ((Category)obj).id))
			return true;
		return false;
	}
}
